package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.mapper.DtsOrderMapper;
import com.qf.pojo.DtsOrder;
import com.qf.service.DtsOrderService;
import com.qf.vo.DayStatis;
import com.qf.vo.StatGoodsVo;
import com.qf.vo.StatOrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Zwnan
 */
@Service
public class DtsOrderServiceImpl implements DtsOrderService {
    @Autowired
    private DtsOrderMapper dtsOrderMapper;


    @Override
    public Long selectCount() {
        return dtsOrderMapper.selectCount(null);
    }

    @Override
    public List<DayStatis> findOrderAmtVo(int statisDaysRang) {
        return dtsOrderMapper.findOrderAmtVo(statisDaysRang);
    }

    @Override
    public IPage<DtsOrder> findPage(Integer page, Integer limit, String sort, String order) {
        IPage<DtsOrder> iPage = new Page<>();

        return dtsOrderMapper.selectPage(iPage,new QueryWrapper<DtsOrder>().eq("deleted", false));
    }

    @Override
    public Integer selectById(Integer id) {

        return dtsOrderMapper.selectUserId(id);
    }

    @Override
    public DtsOrder findById(Integer id) {
        return dtsOrderMapper.selectByOrderId(id);
    }

    @Override
    public List<StatOrderVo> findstatOrder() {
        return dtsOrderMapper.findstatOrder();
    }

    @Override
    public List<StatGoodsVo> findstatGoods() {
        return null;
    }


}
